<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">

    </script>
    <style>
        #mouseMoveArea{
            width: 500px;
            height: 500px;
            border: red solid 1px;
        }
    </style>
</head>
<body>
    <!--  获得当前鼠标的坐标  -->
    我是鼠标的坐标：<span id="mouseAddr"></span>
    <div id="mouseMoveArea">
        在这里移动鼠标
    </div>
    <br>
    <script>
        // 浏览器打开后响应事件
        $(function () {
            // 获取鼠标移动区域的DOM
            $('#mouseMoveArea').mousemove(function (e) {
                // 把坐标显示到指定区域，操作id为mouseAddr的DOM
                $('#mouseAddr').text('x: '+e.pageX+' y: '+e.pageY)
            })
        })
    </script>
</body>
</html>
